<?php
class p_navi extends page_controllor 
{
    public function __construct($get_param)
    {
        $this->__need_login = false;
        parent::__construct($get_param);
    }
    public function run()
    {
        $page = (int)$this->get_input(0);
        $page = in_array($page , array(1,2)) ? $page : 1;
        
        $oArraytree = new lib_arraytree(array());
        $oArraytree->restart(k::config('product_class'));
        $namefield = $this->__isLangEng ? 'eng_name' : 'name';
        $out_data['product_class'] = $oArraytree->get_id2field( $namefield );
//        $out_data['page'] = $page;
        
		$a = helper_filesystem::ls(K5_DATA_PATH.'/images/nav');
		
		$array = array();
		foreach ($a as $file)
		{
			if(!strpos($file , 'jpg'))
				continue;
			$row = substr($file , 0 , strpos($file , '.'));
			$b = explode('-' , $row);
			$fsn = strtoupper($b[0].''.$b[1]);
			$array[] = array(
				'sn' => strtoupper($b[0].'-'.$b[1]),
				'size' => $b[2].'*'.$b[3].'*'.$b[4],
				'file' => $file
			);
		}
		$start = ($page-1)*9;
		$array = array_slice($array , $start , 9);
		$out_data['list']  = $array;

		
		$out_data['notice'] = $this->load_notice();
        $this->set_page_title($this->__lang['gTitle_p_productList'].'_'.$this->__lang['gTitle_page_title']);
        $this->output('navi' , $out_data);
    }
}
?>